//
//  ImageOfButton.m
//  UI-03 Homework 手势 响应者链
//
//  Created by 冀永金 on 16/7/18.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ImageOfButton.h"

@implementation ImageOfButton
- ( nullable instancetype)initWithFrame:(CGRect)frame image:(nullable UIImage *)image target:(nullable id)target action:(nullable SEL)action {
    self = [super initWithFrame:frame];
    if (self) {
        self.image = image;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:target action:action];
        [self addGestureRecognizer:tap];
    }
    return self;
}
+(__nullable instancetype)imageWithFrame:(CGRect)frame image:(nullable UIImage *)image target:(nullable id)target action:(nullable SEL)action {
    return [[ImageOfButton alloc]initWithFrame:frame image:image target:target action:action];
}
@end
